package cn.rubintry.bug.hunting.room.converter

import androidx.room.TypeConverter
import cn.rubintry.bug.hunting.common.extension.toJson
import cn.rubintry.bug.hunting.common.extension.toObject
import cn.rubintry.bug.hunting.pojo.ArticleModel
import com.google.gson.Gson

class ArticleConverter {

    @TypeConverter
    fun  articleJson2Obj(json: String) : ArticleModel{
        return json.toObject()
    }

    @TypeConverter
    fun article2Json(articleModel: ArticleModel) : String{
        return articleModel.toJson()
    }
}